import { IPSApplicationUI } from './ipsapplication-ui';
import { IPSLanguageRes } from '../res/ipslanguage-res';
import { IPSSysCss } from '../res/ipssys-css';
import { PSModelObjectImpl } from '../psmodel-object-impl';

export class PSApplicationUIImpl extends PSModelObjectImpl implements IPSApplicationUI {
  get aCMinChars(): number {
    return this.M.aCMinChars;
  }

  get buttonNoPrivDisplayMode(): 1 | 2 | 6 {
    return this.M.buttonNoPrivDisplayMode;
  }

  get codeName(): string {
    return this.M.codeName;
  }

  protected defaultappviewpssyscss: IPSSysCss | null = null;

  getDefaultAppViewPSSysCss(): IPSSysCss | null {
    if (this.defaultappviewpssyscss != null) return this.defaultappviewpssyscss;
    const value = this.M.getDefaultAppViewPSSysCss;
    if (value == null) {
      return null;
    }
    this.defaultappviewpssyscss = this.getPSModel4('res.IPSSysCss', value, 'getDefaultAppViewPSSysCss') as IPSSysCss;
    return this.defaultappviewpssyscss;
  }

  get defaultAppViewPSSysCss(): IPSSysCss | null {
    return this.getDefaultAppViewPSSysCss();
  }

  getDefaultAppViewPSSysCssMust(): IPSSysCss {
    const value = this.getDefaultAppViewPSSysCss();
    if (value == null) {
      throw new Error('未指定默认应用视图界面样式');
    }
    return value;
  }

  get defaultControlStyle(): string {
    return this.M.defaultControlStyle;
  }

  get dynaModelFilePath(): string {
    return this.M.dynaModelFilePath;
  }

  get formItemEmptyText(): string {
    return this.M.formItemEmptyText;
  }

  get formItemNoPrivDisplayMode(): 1 | 2 {
    return this.M.formItemNoPrivDisplayMode;
  }

  get gridColumnEnableFilter(): 0 | 1 | 2 {
    return this.M.gridColumnEnableFilter;
  }

  get gridColumnEnableLink(): 0 | 1 | 2 {
    return this.M.gridColumnEnableLink;
  }

  get gridColumnNoPrivDisplayMode(): 1 | 2 {
    return this.M.gridColumnNoPrivDisplayMode;
  }

  get gridRowActiveMode(): 0 | 1 | 2 {
    return this.M.gridRowActiveMode;
  }

  get mDCtrlEmptyText(): string {
    return this.M.mDCtrlEmptyText;
  }

  protected mdctrlemptytextpslanguageres: IPSLanguageRes | null = null;

  getMDCtrlEmptyTextPSLanguageRes(): IPSLanguageRes | null {
    if (this.mdctrlemptytextpslanguageres != null) return this.mdctrlemptytextpslanguageres;
    const value = this.M.getMDCtrlEmptyTextPSLanguageRes;
    if (value == null) {
      return null;
    }
    this.mdctrlemptytextpslanguageres = this.getPSModel4('res.IPSLanguageRes', value, 'getMDCtrlEmptyTextPSLanguageRes') as IPSLanguageRes;
    return this.mdctrlemptytextpslanguageres;
  }

  get mDCtrlEmptyTextPSLanguageRes(): IPSLanguageRes | null {
    return this.getMDCtrlEmptyTextPSLanguageRes();
  }

  getMDCtrlEmptyTextPSLanguageResMust(): IPSLanguageRes {
    const value = this.getMDCtrlEmptyTextPSLanguageRes();
    if (value == null) {
      throw new Error('未指定多数据部件默认无值内容语言资源');
    }
    return value;
  }

  get mainMenuAlign(): 'LEFT' | 'TOP' | 'CENTER' | 'TREEEXP' | 'TABEXP_TOP' | 'TABEXP_LEFT' | 'TABEXP_BOTTOM' | 'TABEXP_RIGHT' | 'NONE' {
    return this.M.mainMenuAlign;
  }

  get memo(): string {
    return this.M.memo;
  }

  get name(): string {
    return this.M.name;
  }

  get pFStyle(): string {
    return this.M.pFStyle;
  }

  get pFType(): string {
    return this.M.pFType;
  }

  get uIStyle(): 'DEFAULT' | 'STYLE2' | 'STYLE3' | 'STYLE4' | 'STYLE5' | 'STYLE6' | 'STYLE7' | 'STYLE8' | 'STYLE9' | 'STYLE10' | 'PREVIEW' {
    return this.M.uIStyle;
  }

  get userCat(): string {
    return this.M.userCat;
  }

  get userTag(): string {
    return this.M.userTag;
  }

  get userTag2(): string {
    return this.M.userTag2;
  }

  get userTag3(): string {
    return this.M.userTag3;
  }

  get userTag4(): string {
    return this.M.userTag4;
  }

  get enableCol12ToCol24(): boolean {
    return this.M.enableCol12ToCol24;
  }

  get enableDynaDashboard(): boolean {
    return this.M.enableDynaDashboard;
  }

  get enableFilterStorage(): boolean {
    return this.M.enableFilterStorage;
  }

  get enableUIModelEx(): boolean {
    return this.M.enableUIModelEx != null ? this.M.enableUIModelEx : false;
  }

  get gridEnableCustomized(): boolean {
    return this.M.gridEnableCustomized;
  }

  get gridForceFit(): boolean {
    return this.M.gridForceFit;
  }

  get outputFormItemUpdatePrivTag(): boolean {
    return this.M.outputFormItemUpdatePrivTag;
  }

  get cls(): string {
    return 'PSApplicationUIImpl';
  }

  instanceof(cls: string): boolean {
    if (cls == 'app.IPSApplicationUI') return true;
    return super.instanceof(cls);
  }
}
